/*
 *  CFile.h
 *  Game_Demo
 *
 *  Created by Zhou XiaoHan on 11-2-24.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */


#ifndef __CYQ_CFILE_H__
#define __CYQ_CFILE_H__

#include "../eConfig.h"

class CYQCFile {
public:
	CYQCFile();
	
	~CYQCFile();

	
	boolean Open(const string &strPath);
	
	void Skip(int size);
	
	byte ReadByte();
	
	void ReadBytes(void* buf, int count);
	
	short ReadShort();
	
	short ReadShortReverse();
	
	int ReadInt();
	
	int ReadIntReverse();
	
	long ReadLong();
	
	long ReadLongReverse();
	
	int getLength();
	
	boolean Open();
	void ReadChars(void* buf,int count);
	char ReadChar();
	static int ReadNumber(byte* b, int off, int num, boolean invert);
	static void LoadGameRmsFile();
	static FILE* getGameRmsFile();

private:
	void divFileName(char * file_name, char * str_name, char * str_ext);
	



//	NSData *file_data;
//	NSFileManager *fm;
	unsigned char* file_buff;
	int file_size;
	unsigned char* m_pCur;
};

#endif